package org.example.chengyu.entity;

import java.util.ArrayList;
import java.util.List;

public class CiTiao {

    private String cimu = null;

    private String pinyin = null;

    private String jiegou = null;

    private List<YiXiang> yixiangList =new ArrayList<YiXiang>();

    private String zhuyi = null;

    private List<JinYi> jinyiList =new ArrayList<JinYi>();

    private List<FanYi> fanyiList =new ArrayList<FanYi>();

    private List<Shili> shilis = new ArrayList<Shili>();

    public List<Shili> getShilis() {
        return shilis;
    }


    public void setShilis(List<Shili> shilis) {
        this.shilis = shilis;
    }

    public List<YiXiang> getYixiangList() {
        return yixiangList;
    }

    public List<JinYi> getJinyiList() {
        return jinyiList;
    }

    public List<FanYi> getFanyiList() {
        return fanyiList;
    }

    public void setCimu(String cimu) {
        this.cimu = cimu;
    }

    public void setPinyin(String pinyin) {
        this.pinyin = pinyin;
    }

    public void setJiegou(String jiegou) {
        this.jiegou = jiegou;
    }

    public void setYixiangList(List<YiXiang> yixiangList) {
        this.yixiangList = yixiangList;
    }

    public void setZhuyi(String zhuyi) {
        this.zhuyi = zhuyi;
    }

    public void setJinyiList(List<JinYi> jinyiList) {
        this.jinyiList = jinyiList;
    }

    public void setFanyiList(List<FanYi> fanyiList) {
        this.fanyiList = fanyiList;
    }

    public String toString(){
        StringBuilder sb = new StringBuilder();
        sb.append("<词条>");
        if(cimu != null && !"".equals(cimu)){
            sb.append("<词目>").append(cimu).append("</词目>");
        }
        if(pinyin != null && !"".equals(pinyin)){
            sb.append("<拼音>").append(pinyin).append("</拼音>");
        }
        if(jiegou != null && !"".equals(jiegou)){
            sb.append("<结构>").append(jiegou).append("</结构>");
        }
        for(int i=0; i<yixiangList.size(); i++){
            sb.append(yixiangList.get(i).toString());
        }
        for(int i=0; i<jinyiList.size(); i++){
            sb.append(jinyiList.get(i).toString());
        }
        for(int i=0; i<fanyiList.size(); i++){
            sb.append(fanyiList.get(i).toString());
        }

        for(int i=0; i<shilis.size(); i++){
            sb.append(shilis.get(i).toString());
        }
        if(zhuyi != null && !"".equals(zhuyi)){
            sb.append("<注意>").append(zhuyi).append("</注意>");
        }

        sb.append("</词条>");
        return sb.toString();
    }



}
